
import axios from 'axios';

/**
 * 模型定义
 */
export class ModelService {
    // 分页查询列表
    static findModels (queryParams) {
        return axios({
            url: '/lims/gen/Model/findModels',
            method: 'POST',
            data: queryParams
        });
    }

    //根据ID查询指定的模型定义
    static findModel (modelId) {
        const query = {
            modelId
        }
        return axios({
            url: '/lims/gen/Model/findModel',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的模型定义(包含外键名称)
    static findModelForView (modelId) {
        const query = {
            modelId
        }
        return axios({
            url: '/lims/gen/Model/findModelForView',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的模型定义(包含外键名称)
    static findModelForEdit (modelId) {
        const query = {
            modelId
        }
        return axios({
            url: '/lims/gen/Model/findModelForEdit',
            method: 'POST',
            params: query,
        });
    }

    //根据ID查询指定的模型定义(只提取ID 和 Name)
    static findModelsWithIdNameById (modelId) {
        const query = {
            modelId
        }
        return axios({
            url: '/lims/gen/Model/findModelsWithIdNameById',
            method: 'POST',
            params: query,
        });
    }

    //根据名称查询模型定义集合(只提取ID 和 Name)
    static findModelsWithIdNameByName (modelName) {
        const query = {
            modelName
        }
        return axios({
            url: '/lims/gen/Model/findModelsWithIdNameByName',
            method: 'POST',
            params: query,
        });
    }

    //新增保存模型定义
    static saveModel (model) {
        const query = {}
        return axios({
            url: '/lims/gen/Model/saveModel',
            method: 'POST',
            params: query,
            data: model
        });
    }

    //修改保存模型定义
    static updateModel (model) {
        const query = {}
        return axios({
            url: '/lims/gen/Model/updateModel',
            method: 'POST',
            params: query,
            data: model
        });
    }

    //根据ID查询指定的模型定义(只提取ID 和 Name)
    static deleteModel (modelId) {
        const query = {
            modelId
        }
        return axios({
            url: '/lims/gen/Model/deleteModel',
            method: 'POST',
            params: query,
        });
    }
}
